********************************************************************************
/*
NSF Grant: SciSIP #1548288
	https://www.nsf.gov/awardsearch/showAward?AWD_ID=1548288
	
Manuscript: Influences of Academic Institutional Factors on R&D Funding for Graduate Students
	https://doi.org/10.1093/scipol/scx017

Analysis: Refer to Sections 3 & 4 in Manuscript (Tables 1 - 4)

1: Set Up
	Data Cleaning (Lines: 28 - 377)
	Analysis Set Up (Lines: 378 - 515)

2: Descriptive Statistics	
	Descriptive Statistics (Lines: 516 - 566)
	Descriptive Statistics of Covariates by Academic Division (Lines: 567 - 680)

3: Regression Analysis
	Binary Model Analysis Estimation of Effects on Any Award Activity, Step 1 (Lines 681 - 1077)
	Relative Distribution Model Analysis Estimation of Effects on Concentration of Award Activity, Step 2 (Lines: 1078 - 1305)
	Additional Checks - verify results are similar when covariates are standardized by distribution of department rank or sample (Lines 1306 - 1423)

Primary Author of Analysis: Alexandra Graddy-Reed (University of Southern California, http://graddyreed.weebly.com/)
*/
********************************************************************************

***** Data Cleaning
{
clear all 
set more off
global dir "<set according to user>"
use "$dir/NRC GRFP IPEDS dept cross-section.dta"
*** Preliminary Cleaning
	*Note: 3,325 total departments

** AG & Bio should be combined to form Life Science per NRC Classification (LL)
replace nrc_broad_dept = "Life Sciences" if nrc_broad_dept == "Agricultural Sciences"
replace nrc_broad_dept = "Life Sciences" if nrc_broad_dept == "Biological and Health Sciences"

** Create and clean up the student activity variables (18 unique variables)  
*Shorten names & clean values
rename stu_orientation 					stu_orient 						
rename stu_intl_orientation 			stu_intl_orient						
rename stu_language_support 			stu_langsup
rename stu_writing_support 				stu_writsup
rename stu_statistics_support 			stu_statssup
rename stu_prize_teach_res 				stu_prize						
rename stu_proposal_support 			stu_propsup					
rename stu_oncampus_grad_res_conf 		stu_campusconf				
rename stu_academic_integrity_training	stu_integrity
rename stu_grad_assoc 					stu_gradassoc
rename stu_staff_grad_assoc 			stu_staff_gradassoc				
rename stu_finance_support_grad_assoc 	stu_finan_gradassoc
rename stu_academic_greivance 			stu_grief
rename stu_dispute_resolution 			stu_dispute
rename stu_grad_prog_meeting			stu_prog_meet				
rename stu_annual_review_enrolled 		stu_anreview				
rename stu_teacher_training 			stu_teachskills					
rename stu_travel_support 				stu_travelsup				
rename stu_activities_count				stu_activity_count				
#d;
foreach var in stu_orient stu_intl_orient stu_langsup stu_writsup stu_statssup stu_prize stu_propsup 
	stu_campusconf stu_integrity stu_gradassoc stu_staff_gradassoc stu_finan_gradassoc stu_grief stu_dispute 	
	stu_prog_meet stu_anreview stu_teachskills stu_travelsup { ;
	gen `var'_dum = 1 if (`var' == 2 | `var' == 3) ;
	recode `var'_dum (. = 0) ;
	} ;
#d cr 

** Variables once used
gen pct_allocated_fac = num_allocated_fac_06/tot_fac_06
gen stu_fac_ratio = num_stu_enrolled_05/num_allocated_fac_06
lab var stu_fac_ratio "Student (05 enrollment) to faculty (allocated fac 06) ratio"

** Recode the NRC percentages for ease of interpretation in regression
global NRC_pct_adjust pct_interdis_fac pct_w_academic_plans pct_stu_res_fellow_05 female_fac_pct nonasian_minority_fac_pct pct_tenured_fac pct_allocated_fac pct_fac_w_grants_06 female_stu_pct nonasian_minority_stu_pct
sum $NRC_pct_adjust
foreach x in $NRC_pct_adjust {
replace `x' = `x'*100
lab var `x' "`x': adjusted 1% interpret"
}
	
** Check to see what narrow academic fields NEVER experience any GRFP activity over our 2005-2008 time frame 
	*They will drop out when we add in narrow field fixed effects
tab any_grfp_nochange0508 nrc_dept_full 
bys nrc_dept_full: egen activity_max=max(any_grfp_nochange0508) 
tab activity_max, m
tab nrc_dept_full if activity_max==0, m
	/*3 departments have no GRFP activity: 
	(1) Agricultural and Resource Economics (27)
	(2) Food Science (31)
	(3) Public Health (39)
		Drop these narrow fields now before continuing to clean data*/
drop if activity_max==0 
drop activity_max
	*Now only have 3,228 unique departments to continue cleaning
	
***************************************
***************************************
** Add in additional information for analysis **
*1* Add in University Rankings from Barron's Rankings
sort ipeds
merge m:1 ipeds using "$dir/University rankings/Barron Rankings cleaned to merge.dta"
lab var barron_rank "Barron's University ranking (ordinal)"
	*Only 1 school from Barron's did not merge
drop if _merge==2
drop _merge		
tab barron_rank
	/*Note: 28.74%: Most Competitive
			19.79%: Highly Competitive
			31.87%: Very Competitive
			18.12%: Competitive
			0.46%: Less Competitive
			1.02%: Noncompetitive */
** Barron Rank (simplified groupings into 3 -- for stratification purposes)
gen barron_rank1 = 1 if barron_rank < 3
replace barron_rank1 = 2 if barron_rank == 3
replace barron_rank1 = 3 if barron_rank > 3
tab barron_rank1, gen(uni_rank_dum)
				
*2* Create Department Rankings
	/* In an effort to match, we will stratify the departments by NRC rankings. 
	There are a number of options: S rankings, R rankings (and variations of each).
	We stratify by R rankings, but can test the implications of using S rankings. 
	This picks up the perception/reputation of the department better than the S rankings. */
*Drop all observations missing R and S rankings*
foreach x in R_rank_95th_pct R_rank_5th_pct S_rank_95th_pct S_rank_5th_pct {
	drop if `x'==. 
}
	*Note on missing values: R and S rankings on 98.3% of the NRC sample -- missing for 55 observations.
	*Now have 3,173 departments
** Create numeric identifier for string university and department field variables after dropping 55 above
encode nrc_broad_dept, gen(nrc_broad_dept_cd)
encode nrc_dept_full, gen(nrc_dept_full_cd)
	tab nrc_dept_full_cd
	tab nrc_dept_full_cd, nol		/*41 total unique narrow fields*/
encode nrc_uni, gen(nrc_uni_cd)
*Generate a single ranking for a department based on different hypothesized distributions of a department's rankings*
	*Midpoint between 5th and 95th percentile rankings*
	gen r_mid = (R_rank_95th_pct + R_rank_5th_pct)/2
	gen s_mid = (S_rank_95th_pct + S_rank_5th_pct)/2
	pwcorr r_mid s_mid		/*Corr = .91*/
*Left-skewed distribution between 5th and 95th percentile rankings*
	gen r_lskew = (r_mid + R_rank_5th_pct)/2
	gen s_lskew = (s_mid + S_rank_5th_pct)/2
	pwcorr r_lskew s_lskew  /*Corr = .89*/
*Right-skewed distribution between 5th and 95th percentile rankings*
	gen r_rskew = (r_mid + R_rank_95th_pct)/2
	gen s_rskew = (s_mid + S_rank_95th_pct)/2
	pwcorr r_rskew s_rskew /*Corr = .92*/	
/*Generate quartile and tercile rankings BY DEPARTMENT from the 3 different values -- midpoint, right skew, left skew
(for R and S separately) above and compare rankings*/
	sort nrc_dept_full_cd r_mid
	forvalues x = 1(1)41 {
		xtile R3_mid_dept`x' = r_mid if nrc_dept_full_cd==`x', nq(3)
		xtile R3_lskew_dept`x' = r_lskew if nrc_dept_full_cd==`x', nq(3)
		xtile R3_rskew_dept`x' = r_rskew if nrc_dept_full_cd==`x', nq(3)
		
		xtile S3_mid_dept`x' = s_mid if nrc_dept_full_cd==`x', nq(3)
		xtile S3_lskew_dept`x' = s_lskew if nrc_dept_full_cd==`x', nq(3)
		xtile S3_rskew_dept`x' = s_rskew if nrc_dept_full_cd==`x', nq(3)
		
		xtile R4_mid_dept`x' = r_mid if nrc_dept_full_cd==`x', nq(4)
		xtile R4_lskew_dept`x' = r_lskew if nrc_dept_full_cd==`x', nq(4)
		xtile R4_rskew_dept`x' = r_rskew if nrc_dept_full_cd==`x', nq(4)
		
		xtile S4_mid_dept`x' = s_mid if nrc_dept_full_cd==`x', nq(4)
		xtile S4_lskew_dept`x' = s_lskew if nrc_dept_full_cd==`x', nq(4)
		xtile S4_rskew_dept`x' = s_rskew if nrc_dept_full_cd==`x', nq(4)
	}	
	#d;	
	foreach x in R3_mid R3_lskew R3_rskew S3_mid S3_lskew S3_rskew R4_mid R4_lskew R4_rskew S4_mid S4_lskew S4_rskew { ;
		egen `x' = rowtotal(`x'_dept1 `x'_dept2 `x'_dept3 `x'_dept4 `x'_dept5 `x'_dept6 `x'_dept7 `x'_dept8 
		`x'_dept9 `x'_dept10 `x'_dept11 `x'_dept12 `x'_dept13 `x'_dept14 `x'_dept15 `x'_dept16 `x'_dept17 
		`x'_dept18 `x'_dept19 `x'_dept20 `x'_dept21 `x'_dept22 `x'_dept23 `x'_dept24 `x'_dept25 `x'_dept26
		`x'_dept27 `x'_dept28 `x'_dept29 `x'_dept30 `x'_dept31 `x'_dept32 `x'_dept33 `x'_dept34 `x'_dept35 
		`x'_dept36 `x'_dept37 `x'_dept38 `x'_dept39 `x'_dept40 `x'_dept41) ;
		
		drop `x'_dept1 `x'_dept2 `x'_dept3 `x'_dept4 `x'_dept5 `x'_dept6 `x'_dept7 `x'_dept8 
		`x'_dept9 `x'_dept10 `x'_dept11 `x'_dept12 `x'_dept13 `x'_dept14 `x'_dept15 `x'_dept16 `x'_dept17 
		`x'_dept18 `x'_dept19 `x'_dept20 `x'_dept21 `x'_dept22 `x'_dept23 `x'_dept24 `x'_dept25 `x'_dept26
		`x'_dept27 `x'_dept28 `x'_dept29 `x'_dept30 `x'_dept31 `x'_dept32 `x'_dept33 `x'_dept34 `x'_dept35 
		`x'_dept36 `x'_dept37 `x'_dept38 `x'_dept39 `x'_dept40 `x'_dept41  ;
	} ;
	#d cr
*Check correlations between all quartile and tercile rankings (separately) to see if the chosen assumed distribution matters*
	pwcorr R3_mid S3_mid R3_lskew S3_lskew R3_rskew S3_rskew	/*All correlations are between .73 and .98*/
	pwcorr R4_mid S4_mid R4_lskew S4_lskew R4_rskew S4_rskew	/*All correlations are between .76 and .99*/
*Operatinalize rankings: use tercile rankings for R-rank using the midpoint of the 5th and 95th percentiles*
*But keep S-rankings and quartile versions of both for robustness checks below*
drop r_lskew s_lskew r_rskew s_rskew R4_lskew S4_lskew R3_lskew S3_lskew R4_rskew S4_rskew R3_rskew S3_rskew
sum nrc_dept_id r_mid R4_mid R3_mid s_mid S4_mid S3_mid
*Ensure that WITHIN EACH DEPARTMENT TERCILE RANKING all narrow fields are represented*
	/*Note: This is important because when the sample is stratified below in the regressions, we do not want 
	any narrow fields to drop out with the inclusion of narrow field fixed effects*/
	bys R3_mid: tab nrc_dept_full_cd, nol m
		*All departments appear to be represented

*3* Create Broad Field Indicators 
gen nrc_eng = 1 if nrc_broad_dept == "Engineering"
recode nrc_eng (.=0)
gen nrc_ls = 1 if nrc_broad_dept == "Life Sciences"
recode nrc_ls (.=0)
gen nrc_mps = 1 if nrc_broad_dept == "Physical and Mathematical Sciences"
recode nrc_mps (.=0)
gen nrc_sbs = 1 if nrc_broad_dept == "Social and Behavioral Sciences"
recode nrc_sbs (.=0)
		
*4* Create New Outcome Variable
	*Note: some engineering departments (e.g. GA Tech) have 570 students enrolled
** Awards Ratio
gen award_pro_nochange0508_2 = [award_count_nochange0508/4]/[avg_annual_1styr_enroll*2]
lab var award_pro_nochange0508_2 "Proportion of annual GRFP Awards to eligible graduate cohort"
sum avg_annual_1styr_enroll num_stu_enrolled_05 median_time_to_degree_06 award_pro_nochange0508
	*Have complete data for 3,162 departments (when we look at ratios as the outcome)
** Awards Ratio V2 
gen awardcount0508_exp = award_count_nochange0508
replace awardcount0508_exp = 0 if any_award_grfp_nochange0508 == 0
gen award_pro_nochange0508_3 = [awardcount0508_exp/4]/[avg_annual_1styr_enroll*2]
lab var award_pro_nochange0508_3 "Proportion of annual GRFP Awards to eligible graduate cohort expanded sample"
sum avg_annual_1styr_enroll num_stu_enrolled_05 award_pro_nochange0508*
	*Note: 1 HM-only department is missing because it is missing avg_annual_1styear_enroll

*5* Create Student Activity Ratio 	
	/* 	keep stu_activity_count nrc_dept_full_cd
		collapse (mean) stu_activity_count, by (nrc_dept_full_cd)
		rename stu_activity_count NRCnarrowdept_stu_activity_count
		sort nrc_dept_full_cd
		save "$dir/student count.dta", replace 	*/
sort nrc_dept_full_cd
merge m:1 nrc_dept_full_cd using "$dir/student count.dta"
drop if _merge!=3		/*Drop the 3 academic fields that were dropped previously*/
drop _merge
gen stu_activity_ratio = stu_activity_count/NRCnarrowdept_stu_activity_count
lab var stu_activity_ratio "Student Programs Ratio (narrow dept avg. base)"
gen bin_stuactratio = .
replace bin_stuactratio = 1 if stu_activity_ratio > 1
replace bin_stuactratio = 0 if stu_activity_ratio < 1

***************************************
***************************************

*** Functional Form (Standardized)

*1* Awards Ratios
** Create Standardized Versions 
egen z_award_pro_nochange0508_2 = std(award_pro_nochange0508_2) if any_grfp_nochange0508 == 1
egen z_award_pro_nochange0508_3 = std(award_pro_nochange0508_3) if any_grfp_nochange0508 == 1
** Standardize by Broad Field (Academic Divison): V1
egen z2temp_awardprop_eng = std(award_pro_nochange0508_2) if any_grfp_nochange0508 == 1 & nrc_eng == 1
egen z2temp_awardprop_ls = std(award_pro_nochange0508_2) if any_grfp_nochange0508 == 1 & nrc_ls == 1
egen z2temp_awardprop_mps = std(award_pro_nochange0508_2) if any_grfp_nochange0508 == 1 & nrc_mps == 1
egen z2temp_awardprop_sbs = std(award_pro_nochange0508_2) if any_grfp_nochange0508 == 1 & nrc_sbs == 1
gen z_award_pro_nochange0508_2div = z2temp_awardprop_eng
replace z_award_pro_nochange0508_2div = z2temp_awardprop_ls if z_award_pro_nochange0508_2div == .
replace z_award_pro_nochange0508_2div = z2temp_awardprop_mps if z_award_pro_nochange0508_2div == .
replace z_award_pro_nochange0508_2div = z2temp_awardprop_sbs if z_award_pro_nochange0508_2div == .
** Standardize by Broad Field (Academic Divison): V2
egen z3temp_awardprop_eng = std(award_pro_nochange0508_3) if any_grfp_nochange0508 == 1 & nrc_eng == 1
egen z3temp_awardprop_ls = std(award_pro_nochange0508_3) if any_grfp_nochange0508 == 1 & nrc_ls == 1
egen z3temp_awardprop_mps = std(award_pro_nochange0508_3) if any_grfp_nochange0508 == 1 & nrc_mps == 1
egen z3temp_awardprop_sbs = std(award_pro_nochange0508_3) if any_grfp_nochange0508 == 1 & nrc_sbs == 1
gen z_award_pro_nochange0508_3div = z3temp_awardprop_eng
replace z_award_pro_nochange0508_3div = z3temp_awardprop_ls if z_award_pro_nochange0508_3div == .
replace z_award_pro_nochange0508_3div = z3temp_awardprop_mps if z_award_pro_nochange0508_3div == .
replace z_award_pro_nochange0508_3div = z3temp_awardprop_sbs if z_award_pro_nochange0508_3div == .
drop z2temp* z3temp*

*2* GRE scores, functional form
gen avg_GRE_log = ln(avg_GRE)
sum avg_GRE if any_grfp_nochange0508 == 1
egen z2GRE = std(avg_GRE) if any_grfp_nochange0508 == 1
egen z2temp_GRE_eng = std(avg_GRE) if any_grfp_nochange0508 == 1 & nrc_eng == 1
egen z2temp_GRE_ls = std(avg_GRE) if any_grfp_nochange0508 == 1 & nrc_ls == 1
egen z2temp_GRE_mps = std(avg_GRE) if any_grfp_nochange0508 == 1 & nrc_mps == 1
egen z2temp_GRE_sbs = std(avg_GRE) if any_grfp_nochange0508 == 1 & nrc_sbs == 1
gen z_GRE_div = z2temp_GRE_eng
replace z_GRE_div = z2temp_GRE_ls if z_GRE_div == .
replace z_GRE_div = z2temp_GRE_mps if z_GRE_div == .
replace z_GRE_div = z2temp_GRE_sbs if z_GRE_div == .
drop z2temp_GRE*

*3* Percentages, Ratios, & Continuous to Z-Scores
foreach var in pct_stu_res_fellow_05 pct_fac_w_grants_06 female_fac_pct pct_interdis_fac nonasian_minority_fac_pct female_stu_pct nonasian_minority_stu_pct pct_w_academic_plans avg_pubs_per_fac stu_activity_ratio median_time_to_degree_06 {
egen z`var' = std(`var') if any_grfp_nochange0508 == 1
egen zt`var'_eng = std(`var') if any_grfp_nochange0508 == 1 & nrc_eng == 1
egen zt`var'_ls = std(`var') if any_grfp_nochange0508 == 1 & nrc_ls == 1
egen zt`var'_mps = std(`var') if any_grfp_nochange0508 == 1 & nrc_mps == 1
egen zt`var'_sbs = std(`var') if any_grfp_nochange0508 == 1 & nrc_sbs == 1
gen zdiv_`var' = zt`var'_eng
replace zdiv_`var' = zt`var'_ls if zdiv_`var' == .
replace zdiv_`var' = zt`var'_mps if zdiv_`var' == .
replace zdiv_`var' = zt`var'_sbs if zdiv_`var' == .
}
drop zt*
			
***************************************
***************************************

*** Label Variables for Revised Analysis

** Standardized by Academic Division
label var z_award_pro_nochange0508_3div "Standardized Ratio by Academic Division Across Sample with Any GRFP Activity"
label var z_GRE_div "Standardized Average GRE Quantitative Scores by Academic Division, 2004-2006"
label var zdiv_pct_stu_res_fellow_05 "Standardized Percent of Students with Research Fellowships by Academic Division"
label var zdiv_avg_pubs_per_fac "Standardized Average Number of Publications per Faculty by Academic Division"
label var zdiv_pct_fac_w_grants_06 "Standardized Percent of Faculty with Grants by Academic Division"
label var zdiv_female_fac_pct "Standardized Percent Female Faculty by Acadmeic Division"
label var zdiv_pct_interdis_fac "Standardized Percent of Interdisciplinary Faculty by Acadmeic Division"
label var zdiv_nonasian_minority_fac_pct "Standardized Percent Non-Asian Minority Faculty by Acadmeic Division"
label var zdiv_female_stu_pct "Standardized Percent Female Students by Academic Division"
label var zdiv_nonasian_minority_stu_pct "Standardized Persent of Non-Asian Minority Students by Academic Division"
label var zdiv_pct_w_academic_plans "Standardized Percent of Students with Academic Plans by Academic Division"
label var zdiv_stu_activity_ratio "Standardized Ratio of Student Support Programs to Field Average by Academic Division"
label var zdiv_median_time_to_degree_06 "Standardized Median Time to Degree by Academic Division"

** Independent Variables
label var avg_GRE_log "Average GRE Quantitative Scores (Natural Log), 2004-2006"
label var avg_GRE "Average GRE Quantitative Score, 2004-2006"
label var stu_propsup_dum "Student Proposal Support: Binary"
label var bin_stuactratio "Indicator if Above or Below Field Average in Student Support Programs"
lab var avg_pubs_per_fac "Avg Publications (00-06) per Faculty, 2006"
lab var pct_interdis_fac "Interdisciplinary Faculty (pct)"
lab var female_fac_pct "Female Faculty (pct)"
lab var nonasian_minority_fac_pct "Non-Asian Minority faculty, 2005 (pct)"
lab var stu_fac_ratio "Student:Faculty Ratio"
lab var pct_w_academic_plans "Students w Academic Plans (pct)"
lab var pct_stu_res_fellow_05 "Students w Research Fellowship (pct)"
lab var stu_activity_count "Number of Student Programs (SP), 18 max"
lab var median_time_to_degree_06 "Median Time to Degree"
lab var uni_public "Binary: Public University"
lab var pct_fac_w_grants_06 "Faculty with Grants, 2006 (pct)"
lab var female_stu_pct "Female students, 2005 (pct)"
lab var nonasian_minority_stu_pct "Non-Asian Minority students, 2005 (pct)"
lab var stu_workspace "Student Workspace Provided: Binary"
	
** Rankings
lab var ProgramSize_Q "Program Size, QR"
	tab ProgramSize_Q, m 	
	tab ProgramSize_Q, gen (ProgramSize_Q4_dum)
lab var ProgramSize_Q4_dum1 "Program Size, Q1"	
lab var ProgramSize_Q4_dum2 "Program Size, Q2"	
lab var ProgramSize_Q4_dum3 "Program Size, Q3"	
lab var ProgramSize_Q4_dum4 "Program Size, Q4"	

lab var uni_rank_dum1 "University Rank: High"
lab var uni_rank_dum2 "University Rank: Mid"
lab var uni_rank_dum3 "University Rank: Low"

lab var R3_mid "Department Tercile R-Rankings"
lab var R4_mid "Department Quartile R-Rankings"
lab var S3_mid "Department Tercile S-Rankings"
lab var S4_mid "Department Quartile S-Rankings"

** Expanded Variables
tab RegionalCode, gen (region)
lab var region1 "NE region"
lab var region2 "MW region"
lab var region3 "SA region"
lab var region4 "SC region"
lab var region5 "W region"
	
tab nrc_broad_dept_cd, gen (broad_field)
lab var broad_field1 "ENG"
lab var broad_field2 "LS"
lab var broad_field3 "MPS"
lab var broad_field4 "SS&Psy"
	
tab R3_mid, gen (R3_mid)
lab var R3_mid1 "R3_mid = 1"
lab var R3_mid2 "R3_mid = 2"
lab var R3_mid3 "R3_mid = 3"

save "$dir/Analysis.dta", replace
}

***** Analysis Set Up
{
clear all
use "$dir//Analysis.dta"

	*Spring 2016 - CCA
	*Sample restricted to departments with any GRFP activity
	
** List of Variables: Outcomes 
	/*Step 1: Binary Estimation of Effects on Any Award Activity	
		any_award_grfp_nochange0508 {Binary} Any Award Activity if Any GRFP Activity (2005-2008, current = proposed) 
	Step 2: OLS Estimation of Effects on Concentration of Award Activity 
		award_pro_nochange0508_3 {Ratio} Share of Awards to Eligible Students (2005-2008, current = proposed)
		z_award_pro_nochange0508_3 {Z-Score} Standardized Ratio Across Sample with Any GRFP Activity
		z_award_pro_nochange0508_3div {Z-Score} Standardize Ratio by Academic Division Across Sample with Any GRFP Activity
	Step 3: OLS Estimation of Effects on Concentration of Award Activity Given Award Activity (2005-2008, current = proposed)
		award_pro_nochange0508_2 {Ratio} Share of Awards to Eligible Students Given Award Activity (2005-2008, current = proposed)
		z_award_pro_nochange0508_2 {Z-Score} Standardized Ratio Across Sample with Any Award Activity
		z_award_pro_nochange0508_2div {Z-Score} Standardize Ratio by Academic Division Across Sample with Any Award Activity
		
** Independent Vectors
* Peer Quality:
	GRE Quantitative Score
		avg_GRE_log {Log} Average GRE Quantitative Scores (Natural Log), 2004-2006
		z2GRE {Z-Score} Standardized Average GRE Quantitative Scores, 2004-2006
		z_GRE_div {Z-Score} Standardized Average GRE Quantitative Scores by Academic Division, 2004-2006

* Leadership Quality:	
	Average Publications by Faculty
		avg_pubs_per_fac {Continuous} Average Number of Publications (2000-2006) per Allocated Faculty, 2006
		zavg_pubs_per_fac {Z-Score} Standardized Average Number of Publications per Faculty
		zdiv_avg_pubs_per_fac {Z-Score} Standardized Average Number of Publications per Faculty by Academic Division
	Faculty with Grants 
		pct_fac_w_grants_06 {Percent} Percent of Faculty with Grants
		zpct_fac_w_grants_06 {Z-Score} Standardized Percent of Faculty with Grants
		zdiv_pct_fac_w_grants_06 {Z-Score} Standardized Percent of Faculty with Grants by Academic Division

* Leadership Composition:	
	Female Faculty
		female_fac_pct {Percent} Percent Female Faculty, 2006
		zfemale_fac_pct {Z-Score} Standardized Percent Female Faculty
		zdiv_female_fac_pct {Z-Score} Standardized Percent Female Faculty by Acadmeic Division
	Interdisciplinary Faculty
		pct_interdis_fac {Percent} Percent of Interdisciplinary Faculty, 2006
		zpct_interdis_fac {Z-Score} Standardized Percent of Interdisciplinary Faculty
		zdiv_pct_interdis_fac {Z-Score} Standardized Percent of Interdisciplinary Faculty by Acadmeic Division
	Non-Asian Minority Faculty
		nonasian_minority_fac_pct {Percent} Percent Non-Asian Minority Faculty, 2006
		znonasian_minority_fac_pct {Z-Score} Standardized Percent Non-Asian Minority Faculty
		zdiv_nonasian_minority_fac_pct {Z-Score} Standardized Percent Non-Asian Minority Faculty by Acadmeic Division

* Peer Composition:	
	Female Students
		female_stu_pct {Percent} Percent Female Students
		zfemale_stu_pct {Z-Score} Standardized Percent Female Students
		zdiv_female_stu_pct {Z-Score} Standardized Percent Female Students by Academic Division
	Non-Asian Minority Students
		nonasian_minority_stu_pct {Percent} Persent of Non-Asian Minority Students
		znonasian_minority_stu_pct {Z-Score} Standardized Persent of Non-Asian Minority Students
		zdiv_nonasian_minority_stu_pct {Z-Score} Standardized Persent of Non-Asian Minority Students by Academic Division
	Students with Academic Plans
		pct_w_academic_plans {Percent} Percent of Students with Academic Plans, 2001-2005
		zpct_w_academic_plans {Z-Score} Standardized Percent of Students with Academic Plans
		zdiv_pct_w_academic_plans {Z-Score} Standardized Percent of Students with Academic Plans by Academic Division

* Department Support:	
	Student Services Provided
		stu_workspace {Binary} Student Workspace Provided
		stu_propsup_dum {Binary} Proposal Support Available
		stu_activity_ratio {Ratio} Ratio of Student Support Programs to Field Average
		zstu_activity_ratio {Z-Score} Standardized Ratio of Student Support Programs to Field Average
		zdiv_stu_activity_ratio {Z-Score} Standardized Ratio of Student Support Programs to Field Average by Academic Division
		bin_stuactratio {Binary} Indicator if Above or Below Field Average in Student Support Programs
	Median Time to Degree
		median_time_to_degree_06 {Continuous} Median Time to Degree, 2004-2006
		zmedian_time_to_degree_06 {Z-Score} Standardized Median Time to Degree
		zdiv_median_time_to_degree_06 {Z-Score} Standardized Median Time to Degree by Academic Division
	Program Size
		ProgramSize_Q {Binary} Program Size Quartile Ranking, Fall 2005
			ProgramSize_Q4_dum1; ProgramSize_Q4_dum2; ProgramSize_Q4_dum3; ProgramSize_Q4_dum4

* University Traits:
		RegionalCode {Binary} Region	
			region1; region2; region3; region4; region5
		uni_public {Binary} Public University
		uni_rank_dum1; uni_rank_dum2; uni_rank_dum3 {Binary} University Rank   

* FEs and Stratifications:
		nrc_dept_full_cd {Fixed Effects} Narrow Fields
		R3_mid {Stratification} Department Rank		
			R3_mid1; R3_mid2; R3_mid3 	*/	

** Create global macros for base form
global outcomes any_award_grfp_nochange0508 award_pro_nochange0508_3 award_pro_nochange0508_2
global peer_quality avg_GRE_log   
global leader_quality avg_pubs_per_fac pct_fac_w_grants_06
global leader_comp female_fac_pct pct_interdis_fac nonasian_minority_fac_pct
global peer_comp female_stu_pct nonasian_minority_stu_pct pct_w_academic_plans
global dept_support stu_workspace stu_propsup_dum bin_stuactratio median_time_to_degree_06 /// 
		ProgramSize_Q4_dum2 ProgramSize_Q4_dum3 ProgramSize_Q4_dum4
global uni_trait region1 region2 region3 region5 uni_public uni_rank_dum1 uni_rank_dum2
	*All binary so no z or z-div version
	
** Create global macros for standardized form {Binary Vars included as is}
global z_peer_quality z2GRE 
global z_leader_quality zavg_pubs_per_fac zpct_fac_w_grants_06
global z_leader_comp zfemale_fac_pct zpct_interdis_fac znonasian_minority_fac_pct
global z_peer_comp zfemale_stu_pct znonasian_minority_stu_pct zpct_w_academic_plans
global z_dept_support stu_workspace stu_propsup_dum bin_stuactratio zmedian_time_to_degree_06 /// 
		ProgramSize_Q4_dum2 ProgramSize_Q4_dum3 ProgramSize_Q4_dum4
		
** Create global macros for standardized form by academic division {Binary Vars included as is}
global zdiv_peer_quality z_GRE_div 
global zdiv_leader_quality zdiv_avg_pubs_per_fac zdiv_pct_fac_w_grants_06
global zdiv_leader_comp zdiv_female_fac_pct zdiv_pct_interdis_fac zdiv_nonasian_minority_fac_pct
global zdiv_peer_comp zdiv_female_stu_pct zdiv_nonasian_minority_stu_pct zdiv_pct_w_academic_plans
global zdiv_dept_support stu_workspace stu_propsup_dum bin_stuactratio zdiv_median_time_to_degree_06 /// 
		ProgramSize_Q4_dum2 ProgramSize_Q4_dum3 ProgramSize_Q4_dum4	
	*Note: ProgramSize_Q4_dum1 (SMALLEST) region4 (SMALLEST) uni_rank_dum3 (LOWEST RANK) serve as referent categories	

** Setup CCA
sum any_award_grfp_nochange0508 award_pro_nochange0508_3 $leader_quality $leader_comp $peer_quality $peer_comp ///
$dept_support $uni_trait R3_mid if any_grfp_nochange0508 == 1 
foreach x in any_award_grfp_nochange0508 award_pro_nochange0508_3 $leader_quality $leader_comp $peer_quality $peer_comp ///
		$dept_support $uni_trait R3_mid {
		drop if `x' == . 
	}  
	*Original total fields: 1034; cleaned sample of fields: 1033 - one HM only department does not eligible FY cohort size
sort nrc_uni
egen uni_count = group(nrc_uni)
egen uni_dept_count = group(id_merge)
sum uni_count uni_dept_count

** Table A1 NRC Department Sample Frequency
tab nrc_dept_full_cd
tab nrc_dept_full_cd, nol
	*Note for the CCA, we look at 142 universities, for 1033 unique departments, from 41 narrow fields
}
***** Descriptive Statistics 
{
	*CCA 2005 - 2008 GRFP Any Activity Sample
	
** Table 1 Descriptive Statistics of Sample & Outcome Variables by Academic Division
encode nrc_broad_dept, gen(nrcbroaddept)
gen dept_rank1 = R3_mid
gen deptrank = (R3_mid == 1)
tab any_award_grfp_nochange0508 
	*Number of active departments: 1033; 643 with awards, 390 with HMs only
*Academic Divisions
	tab nrcbroaddept, m
*Academic Field Distribution	
	sort nrc_dept_full_cd nrcbroaddept 
	forvalues x = 1(1)4 {
		egen field_count_div`x' = group(nrc_dept_full_cd) if nrcbroaddept == `x'
		sum nrc_dept_full_cd field_count_div`x' 
	}
*University Distribution
	sort nrc_uni nrc_dept_full_cd nrcbroaddept 
	forvalues x = 1(1)4 {
		egen uni_count_div`x' = group(nrc_uni) if nrcbroaddept == `x'
		sum uni_count uni_count_div`x' 
	}
*Number of departments with ANY GRFP awards and ONLY honorable mentions
	tab any_award_grfp_nochange0508 nrcbroaddept, m col
*Number of departments by field with any GRFP HMs
	gen any_honorable_grfp_nochange0508 = 0 if any_grfp_nochange0508 == 1
	foreach x in grfp_nochange_mention2005 grfp_nochange_mention2006 grfp_nochange_mention2007 grfp_nochange_mention2008 {
	replace any_honorable_grfp_nochange0508 = 1 if `x' > 0 & `x' !=.
	}
	tab any_honorable_grfp_nochange0508 nrcbroaddept, col
*Total Number of Awards/Honorable Mentions	
	#d;
	egen Any_activity_count_nochange0508 = rowtotal(grfp_nochange_mention2005 grfp_nochange_award2005 
	grfp_nochange_mention2006 grfp_nochange_award2006 grfp_nochange_mention2007 grfp_nochange_award2007 
	grfp_nochange_mention2008 grfp_nochange_award2008) ;
	#d cr
	recode Any_activity_count_nochange0508 (0=.) 
	lab var Any_activity_count_nochange0508 "Activity Count (Awards & HMs) 0508 (cur=pro institution)" 
foreach y in Any_activity_count award_count mention_count {
	egen total`y' = total(`y'_nochange0508)
foreach x in nrcbroaddept { 
	egen tot`y'eng = total(`y'_nochange0508) if `x'==1
	egen tot`y'ls = total(`y'_nochange0508) if `x'==2
	egen tot`y'mps = total(`y'_nochange0508) if `x'==3
	egen tot`y'sbs = total(`y'_nochange0508) if `x'==4
	}
	}
sum  Any_activity_count_nochange0508 tot*
}	
***** Descriptive Statistics of Covariates by Academic Division 
{ 
* Descriptive Statistics of Covariates -- Overall 
	#d;
	eststo clear;
	eststo: estpost sum $outcomes $leader_quality $leader_comp $peer_quality avg_GRE $peer_comp $dept_support stu_activity_count ProgramSize_Q4_dum1 region4 uni_rank_dum3 $uni_trait ;
	esttab using "$dir/Spr16Analysis/Descriptive_Stats.csv", label title(Descriptive Statistics by Academic Division)
	mtitle ("Full Sample") 
	cells("count(fmt(0)) mean(fmt(3)) sd(fmt(3)) min(fmt(3)) max(fmt(3))") replace plain ;
	#d cr
* Descripitve Statistics of Covariates -- Stratified by Academic Division
	#d;
	eststo clear;
	bys nrcbroaddept: eststo: estpost sum $outcomes $leader_quality $leader_comp $peer_quality avg_GRE $peer_comp $dept_support stu_activity_count ProgramSize_Q4_dum1 region4 uni_rank_dum3 $uni_trait ;
	esttab using "$dir/Spr16Analysis/Descriptive_Stats.csv", label title(Descriptive Statistics by Academic Division)
	cells("count(fmt(0)) mean(fmt(3)) sd(fmt(3))") append plain ;
	#d cr
* Descriptive Statistics of Covariats -- Stratified by Rank
	#d;
	eststo clear;
	bys deptrank: eststo: estpost sum $outcomes $leader_quality $leader_comp $peer_quality avg_GRE $peer_comp $dept_support stu_activity_count ProgramSize_Q4_dum1 region4 uni_rank_dum3 $uni_trait ;
	esttab using "$dir/Spr16Analysis/Descriptive_Stats.csv", label title(Descriptive Statistics by Department Rank)
	cells("count(fmt(0)) mean(fmt(3)) sd(fmt(3))") append plain ;
	#d cr
* Statistical Difference by Rank
log using "$dir/Spr16Analysis/Ttests.log", replace
foreach var in any_award_grfp_nochange0508 award_pro_nochange0508_3 award_pro_nochange0508_2 {
sum `var' 
ttest `var', by(deptrank)
}
foreach var in avg_pubs_per_fac pct_fac_w_grants_06 female_fac_pct pct_interdis_fac nonasian_minority_fac_pct {
sum `var' 
ttest `var', by(deptrank)
}
foreach var in avg_GRE female_stu_pct nonasian_minority_stu_pct pct_w_academic_plans {
sum `var' 
ttest `var', by(deptrank)
}
foreach var in stu_workspace stu_propsup_dum bin_stuactratio stu_activity_count median_time_to_degree_06 {
sum `var' 
ttest `var', by(deptrank)
}
foreach var in ProgramSize_Q4_dum1 ProgramSize_Q4_dum2 ProgramSize_Q4_dum3 ProgramSize_Q4_dum4 {
sum `var' 
ttest `var', by(deptrank)
}
foreach var in region1 region2 region3 region4 region5 uni_public uni_rank_dum1 uni_rank_dum2 uni_rank_dum3  {
sum `var' 
ttest `var', by(deptrank)
}
log close

* Outlier Examination
edit if award_pro_nochange0508_3 > 0.4 & award_pro_nochange0508_3 !=.
	* Oregon State University - Animal Science Program - Average annual enrollment 1.8; Award Count 2005-2008 6 (2 in 05, 2 in 06, 1 in 07, 1 in 08); Proportion 0.42

* Dept & Uni Rank Correlation
gen unirank = .
replace unirank = 1 if uni_rank_dum1 == 1
replace unirank = 2 if uni_rank_dum2 == 1
replace unirank = 3 if uni_rank_dum3 == 1
tab R3_mid unirank, col
pwcorr R3_mid unirank
	* 0.3562
pwcorr uni_rank_dum1 R3_mid1 
	* 0.3205 
pwcorr uni_rank_dum2 R3_mid2
	* 0.0966
pwcorr uni_rank_dum3 R3_mid3
	* 0.1712 
	
** Alternate Descriptives Table by Award/HM Stratification
	#d;
	eststo clear;
	eststo: estpost sum $outcomes $leader_quality $leader_comp $peer_quality avg_GRE $peer_comp $dept_support stu_activity_count ProgramSize_Q4_dum1 region4 uni_rank_dum3 $uni_trait ;
	esttab using "$dir/Spr16Analysis/AltDescStats_AwardStrat.csv", label title(Descriptive Statistics by Program Award Threshold)
	mtitle ("Full Sample") 
	cells("count(fmt(0)) mean(fmt(3)) sd(fmt(3))") replace plain ;

	eststo clear;
	bys any_award_grfp_nochange0508: eststo: estpost sum $outcomes $leader_quality $leader_comp $peer_quality avg_GRE $peer_comp $dept_support stu_activity_count ProgramSize_Q4_dum1 region4 uni_rank_dum3 $uni_trait ;
	esttab using "$dir/Spr16Analysis/AltDescStats_AwardStrat.csv", label title(Descriptive Statistics by Program Award Threshold)
	cells("count(fmt(0)) mean(fmt(3)) sd(fmt(3))") append plain ;
	#d cr

* Statistical Difference by Rank
log using "$dir/Spr16Analysis/Ttests_AltStrat.log", replace
foreach var in award_pro_nochange0508_3 {
sum `var' 
ttest `var', by(any_award_grfp_nochange0508)
}
foreach var in avg_pubs_per_fac pct_fac_w_grants_06 female_fac_pct pct_interdis_fac nonasian_minority_fac_pct {
sum `var' 
ttest `var', by(any_award_grfp_nochange0508)
}
foreach var in avg_GRE female_stu_pct nonasian_minority_stu_pct pct_w_academic_plans {
sum `var' 
ttest `var', by(any_award_grfp_nochange0508)
}
foreach var in stu_workspace stu_propsup_dum bin_stuactratio stu_activity_count median_time_to_degree_06 {
sum `var' 
ttest `var', by(any_award_grfp_nochange0508)
}
foreach var in ProgramSize_Q4_dum1 ProgramSize_Q4_dum2 ProgramSize_Q4_dum3 ProgramSize_Q4_dum4 {
sum `var' 
ttest `var', by(any_award_grfp_nochange0508)
}
foreach var in region1 region2 region3 region4 region5 uni_public uni_rank_dum1 uni_rank_dum2 uni_rank_dum3  {
sum `var' 
ttest `var', by(any_award_grfp_nochange0508)
}
log close
}
	
***** Binary Model Analysis Estimation of Effects on Any Award Activity, Step 1 
{
	*Examination of department characteristics from 2002 - 2006 that are associated with being "Any Award" in GRFP "Any" sample between 2005 - 2008
	*Sample of Cleaned NRS dataset of Any GRFP Activity (1,029 department observations)
	*Model Specification: Logit
	*Post-Specification Tests: Probit, OLS (cluster by field)
	*Outcome: any_award_grfp_nochange0508
	*Controls:
		*Base Form Globals: peer_quality leader_quality leader_comp peer_comp dept_support uni_trait
		*Z Score Globals: z_peer_quality z_leader_quality z_leader_comp z_peer_comp z_dept_support uni_trait
		*Z Score by Division Globals: zdiv_peer_quality zdiv_leader_quality zdiv_leader_comp zdiv_peer_comp zdiv_dept_support uni_trait
	*FE: nrc_dept_full_cd
	*Stratification: dept_rank1 or R3_mid
	
*1* Base Form Globals, No FE, Logit Building & Full, Probit Full, OLS Full
foreach x in any_award_grfp_nochange0508 {
quietly logit `x' $leader_quality $leader_comp  
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", replace dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", replace dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, ME) label addtext(Fixed Effects, No)

quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp 
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, ME) label addtext(Fixed Effects, No)

quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, ME) label addtext(Fixed Effects, No)

quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, ME) label addtext(Fixed Effects, No)

quietly probit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, ME) label addtext(Fixed Effects, No)

quietly reg `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait, cluster (nrc_dept_full_cd)
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Coeff_ME) label addtext(Fixed Effects, No)
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) ctitle(Cluster LPM, Full, Coeff_ME) label addtext(Fixed Effects, No)
}

*2* Base Form Globals, FE, Logit Building & Full, Probit Full, OLS Full
foreach x in any_award_grfp_nochange0508 {
quietly logit `x' $leader_quality $leader_comp i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly probit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly reg `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) ctitle(Cluster LPM, Full, Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
}	

** Post Specification Test to Compare Logit to Probit with FE
	*Logit it is - though barely and assumes normaility
eststo logit1: quietly logit any_award_grfp_nochange0508 $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd
eststo probit1: quietly probit any_award_grfp_nochange0508 $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd
estimates stats logit1 probit1
/* 	-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
	-------------+---------------------------------------------------------------
      logit1 |      1,024 -678.9545  -562.8495      61    1247.699   1548.519
     probit1 |      1,024 -678.9545  -562.3177      61    1246.635   1547.455
	-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.
	The AIC and BIC are slightly smaller for the probit than the logit, so that is our preferred specification. */

*3* Base Form Globals, FE & No FE, Logit Strat by Rank
	*R3/Dept Rank: 1 top tercile; 2 mid tercile; 3 bottom tercile 
foreach x in any_award_grfp_nochange0508 {
preserve
keep if dept_rank1 == 1
quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Coeff, Rank 1) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, ME, Rank 1) label addtext(Fixed Effects, No)

quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Coeff, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly probit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Coeff, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly reg `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore

preserve
keep if dept_rank1 !=1
quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Coeff, Rank 2 and 3) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, ME, Rank 2 and 3) label addtext(Fixed Effects, No)

quietly logit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Coeff, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly probit `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Coeff, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly reg `x' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step1coef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Coeff_ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
outreg2 using "$dir/Spr16Analysis/Step1me.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Coeff_ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore
}

*4* Z-Score Globals, No FE, Logit Building & Full, Probit Full, OLS Full
foreach x in any_award_grfp_nochange0508 {
quietly logit `x' $z_leader_quality $z_leader_comp  
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", replace dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Z-Score Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", replace dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Z-Score ME) label addtext(Fixed Effects, No)

quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp 
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Z-Score Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Z-Score ME) label addtext(Fixed Effects, No)

quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Z-Score Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Z-Score ME) label addtext(Fixed Effects, No)

quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score ME) label addtext(Fixed Effects, No)

quietly probit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-Score Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-Score ME) label addtext(Fixed Effects, No)

quietly reg `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait, cluster (nrc_dept_full_cd)
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-Score Coeff_ME) label addtext(Fixed Effects, No)
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) ctitle(Cluster LPM, Full, Z-Score Coeff_ME) label addtext(Fixed Effects, No)
}

*5* Z-Score Globals, FE, Logit Building & Full, Probit Full, OLS Full
foreach x in any_award_grfp_nochange0508 {
quietly logit `x' $z_leader_quality $z_leader_comp i.nrc_dept_full_cd 
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Z-Score Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Z-Score ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Z-Score Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Z-Score ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Z-Score Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Z-Score ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly probit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-Score Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-Score ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly reg `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) ctitle(Cluster LPM, Full, Z-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
}

*6* Z-Score Globals, FE, Logit Strat by Rank
foreach x in any_award_grfp_nochange0508 {
preserve
keep if dept_rank1 == 1
quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score Coeff, Rank 1) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score ME, Rank 1) label addtext(Fixed Effects, No)

quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score Coeff, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly probit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-Score Coeff, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-Score ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly reg `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-Score Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-Score Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore

preserve
keep if dept_rank1 != 1
quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score Coeff, Rank 2 and 3) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score ME, Rank 2 and 3) label addtext(Fixed Effects, No)

quietly logit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score Coeff, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-Score ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly probit `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-Score Coeff, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-Score ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly reg `x' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step1zcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-Score Coeff_ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
outreg2 using "$dir/Spr16Analysis/Step1zme.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-Score Coeff_ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore
}

*7* Div Z-Score Globals, No FE, Logit Building & Full, Probit Full, OLS Full
foreach x in any_award_grfp_nochange0508 {
quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp  
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", replace dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Z-ScoreDiv Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", replace dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Z-ScoreDiv ME) label addtext(Fixed Effects, No)

quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp 
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Z-ScoreDiv Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Z-ScoreDiv ME) label addtext(Fixed Effects, No)

quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Z-ScoreDiv Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Z-ScoreDiv ME) label addtext(Fixed Effects, No)

quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv ME) label addtext(Fixed Effects, No)

quietly probit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-ScoreDiv Coeff) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-ScoreDiv ME) label addtext(Fixed Effects, No)

quietly reg `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait, cluster (nrc_dept_full_cd)
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-ScoreDiv Coeff_ME) label addtext(Fixed Effects, No)
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) ctitle(Cluster LPM, Full, Z-ScoreDiv Coeff_ME) label addtext(Fixed Effects, No)
}
		
*8* Div Z-Score Globals, FE, Logit Building & Full, Probit Full, OLS Full
foreach x in any_award_grfp_nochange0508 {
quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Z-ScoreDiv Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Z-ScoreDiv Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Z-ScoreDiv Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Leadership Peer Dept, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly probit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-ScoreDiv Coeff) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly reg `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-ScoreDiv Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) ctitle(Cluster LPM, Full, Z-ScoreDiv Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
}

*9* Div Z-Score Globals, FE, Logit Strat by Rank
foreach x in any_award_grfp_nochange0508 {
preserve
keep if dept_rank1 == 1
quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv Coeff, Rank 1) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv ME, Rank 1) label addtext(Fixed Effects, No)

quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv Coeff, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly probit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-ScoreDiv Coeff, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-ScoreDiv ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly reg `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-ScoreDiv Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-ScoreDiv Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore

preserve
keep if dept_rank1 != 1
quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv Coeff, Rank 2 and 3) label addtext(Fixed Effects, No)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv ME, Rank 2 and 3) label addtext(Fixed Effects, No)

quietly logit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv Coeff, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Full, Z-ScoreDiv ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly probit `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-ScoreDiv Coeff, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Probit, Full, Z-ScoreDiv ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly reg `x' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step1zdcoef.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-ScoreDiv Coeff_ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
outreg2 using "$dir/Spr16Analysis/Step1zdme.xls", append dec(3) e(ll r2_p rmse) ctitle(Cluster LPM, Full, Z-ScoreDiv Coeff_ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore
}


*10* Sensitivity Check: Div Z-Score Globals, FE, Logit Full with Alterate Bottom Threshold
	* Reviewer wants to see alternate bottom threshold - trying minimum of two awards
gen binaryaward0508_base2 = .
replace binaryaward0508_base2 = 0 if awardcount0508_exp == 0
replace binaryaward0508_base2 = 0 if awardcount0508_exp == 1
replace binaryaward0508_base2 = 1 if awardcount0508_exp > 1 & awardcount0508_exp != .
		* 690 obs with 0 (390) or 1 (300) award; 343 with at least 2
	* Alternate version omits those with one award
gen binaryaward0508_base2v2 = .
replace binaryaward0508_base2v2 = 0 if awardcount0508_exp == 0
replace binaryaward0508_base2v2 = 1 if awardcount0508_exp > 1 & awardcount0508_exp != .

quietly logit any_award_grfp_nochange0508 $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdmeAltbase.xls", replace dec(3) e(ll r2_p rmse) ctitle(Logit, Base One, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit binaryaward0508_base2 $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdmeAltbase.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Base Two, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit binaryaward0508_base2v2 $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdmeAltbase.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Base Two No Ones, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

*11* Sensitivity Check: Div Z-Score Globals, FE, Logit Full without Social Science Division
quietly logit any_award_grfp_nochange0508 $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdmeNoSS.xls", replace dec(3) e(ll r2_p rmse) ctitle(Logit, Full Sample, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)

quietly logit any_award_grfp_nochange0508 $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd if nrcbroaddept != 4
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/Step1zdmeNoSS.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, No SS Div, Z-ScoreDiv ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
}

***** Relative Distribution Model Analysis Estimation of Effects on Concentration of Award Activity, Step 2
{
	*Examination of department characteristics from 2002 - 2006 that are associated with higher concentration of awards of eligible students in GRFP "Any" sample between 2005 - 2008
	*Sample of Cleaned NRC dataset of Any GRFP Activity (1,029 department observations)
	*Model Specification: OLS
	*Outcome: award_pro_nochange0508_3; z_award_pro_nochange0508_3; z_award_pro_nochange0508_3div
	*Controls:
		*Base Form Globals: peer_quality leader_quality leader_comp peer_comp dept_support uni_trait
		*Z Score Globals: z_peer_quality z_leader_quality z_leader_comp z_peer_comp z_dept_support uni_trait
		*Z Score by Division Globals: zdiv_peer_quality zdiv_leader_quality zdiv_leader_comp zdiv_peer_comp zdiv_dept_support uni_trait
	*FE: nrc_dept_full_cd
	*Stratification: dept_rank1 or R3_mid
			
*1* Base Form Globals, No FE, OLS Building & Full
foreach x1 in award_pro_nochange0508_3 {
quietly reg `x1' $leader_quality $leader_comp, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", replace dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, Coeff_ME) label addtext(Fixed Effects, No) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, Coeff_ME) label addtext(Fixed Effects, No) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, Coeff_ME) label addtext(Fixed Effects, No) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Coeff_ME) label addtext(Fixed Effects, No) 
}

*2* Base Form Globals, FE, OLS Building & Full
foreach x1 in award_pro_nochange0508_3 {
quietly reg `x1' $leader_quality $leader_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
}

*3* Base Form Globals, FE, OLS Strat by Rank
bys R3_mid: tab any_grfp_nochange0508 
bys R3_mid: tab any_award_grfp_nochange0508
	/*In Top Tercile R3_mid==1, 611 departments have ANY GRFP activity, and out of those, 434 have awards
	In Middle Tercile R3_mid==2, 289 departments have ANY GRFP activity, and out of those, 156 have awards
	In Bottom Tercile R3_mid==3, 133 departments have ANY GRFP activity, and out of those, 53 have awards */
preserve
keep if dept_rank1 == 1
foreach x1 in award_pro_nochange0508_3 {
quietly reg `x1' $leader_quality $leader_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Coeff_ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Coeff_ME, Rank 1) label addtext(Fixed Effects, No) 
}
restore
preserve
keep if dept_rank1 != 1
foreach x1 in award_pro_nochange0508_3 {
quietly reg `x1' $leader_quality $leader_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $leader_quality $leader_comp $peer_quality $peer_comp $dept_support $uni_trait, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Coeff_ME, Rank2and3) label addtext(Fixed Effects, No) 
}
restore

*4* Z-Score Globals, No FE, OLS Building & Full
foreach x1 in z_award_pro_nochange0508_3 {
quietly reg `x1' $z_leader_quality $z_leader_comp, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", replace dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, Z-Score Coeff_ME) label addtext(Fixed Effects, No) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, Z-Score Coeff_ME) label addtext(Fixed Effects, No) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, Z-Score Coeff_ME) label addtext(Fixed Effects, No) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Z-Score Coeff_ME) label addtext(Fixed Effects, No) 
}	
	
*5* Z-Score Globals, FE, OLS Building & Full
foreach x1 in z_award_pro_nochange0508_3 {
quietly reg `x1' $z_leader_quality $z_leader_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, Z-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, Z-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, Z-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Z-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
}

*6* Z-Score Globals, FE, OLS Strat by Rank
preserve
keep if dept_rank1 == 1
foreach x1 in z_award_pro_nochange0508_3 {
quietly reg `x1' $z_leader_quality $z_leader_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, Z-Score Coeff_ME, Rank1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, Z-Score Coeff_ME, Rank1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, Z-Score Coeff_ME, Rank1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Z-Score Coeff_ME, Rank1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Z-Score Coeff_ME, Rank1) label addtext(Fixed Effects, No) 
}
restore
preserve
keep if dept_rank1 != 1
foreach x1 in z_award_pro_nochange0508_3 {
quietly reg `x1' $z_leader_quality $z_leader_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, Z-Score Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, Z-Score Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, Z-Score Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Z-Score Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $z_leader_quality $z_leader_comp $z_peer_quality $z_peer_comp $z_dept_support $uni_trait, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2z.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, Z-Score Coeff_ME, Rank2and3) label addtext(Fixed Effects, No) 
}
restore

*7* Div Z-Score Globals, No FE, OLS Building & Full
foreach x1 in z_award_pro_nochange0508_3div {
quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", replace dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, DivZ-Score Coeff_ME) label addtext(Fixed Effects, No) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, DivZ-Score Coeff_ME) label addtext(Fixed Effects, No) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, DivZ-Score Coeff_ME) label addtext(Fixed Effects, No) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, DivZ-Score Coeff_ME) label addtext(Fixed Effects, No) 
}	

*8* Div Z-Score Globals, FE, OLS Building & Full
foreach x1 in z_award_pro_nochange0508_3div {
quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, DivZ-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, DivZ-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, DivZ-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, DivZ-Score Coeff_ME) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
}	

*9* Div Z-Score Globals, FE, OLS Strat by Rank
preserve
keep if dept_rank1 == 1
foreach x1 in z_award_pro_nochange0508_3div {
quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, DivZ-Score Coeff_ME, Rank1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, DivZ-Score Coeff_ME, Rank1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, DivZ-Score Coeff_ME, Rank1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, DivZ-Score Coeff_ME, Rank1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, DivZ-Score Coeff_ME, Rank1) label addtext(Fixed Effects, No) 
}
restore
preserve
keep if dept_rank1 != 1
foreach x1 in z_award_pro_nochange0508_3div {
quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader, DivZ-Score Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer, DivZ-Score Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Leader Peer Dept, DivZ-Score Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, DivZ-Score Coeff_ME, Rank2and3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 

quietly reg `x1' $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/Step2dz.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Full, DivZ-Score Coeff_ME, Rank2and3) label addtext(Fixed Effects, No) 
}
restore
}
***** Additional Checks - verify results are similar when covariates are standardized by distribution of department rank or sample
{
** Create Standardized Versions by Department Rank
egen ztemprank1_awardpro_2 = std(award_pro_nochange0508_2) if any_grfp_nochange0508 == 1 & dept_rank1 == 1
egen ztemprank2_awardpro_2 = std(award_pro_nochange0508_2) if any_grfp_nochange0508 == 1 & dept_rank1 != 1
gen zrank_awardpro_2 = ztemprank1_awardpro_2
replace zrank_awardpro_2 = ztemprank2_awardpro_2 if zrank_awardpro_2 == .
egen ztemprank1_awardpro_3 = std(award_pro_nochange0508_3) if any_grfp_nochange0508 == 1 & dept_rank1 == 1
egen ztemprank2_awardpro_3 = std(award_pro_nochange0508_3) if any_grfp_nochange0508 == 1 & dept_rank1 != 1
gen zrank_awardpro_3 = ztemprank1_awardpro_3
replace zrank_awardpro_3 = ztemprank2_awardpro_3 if zrank_awardpro_3 == .
drop ztemp*

foreach var in avg_GRE pct_fac_w_grants_06 female_fac_pct pct_interdis_fac nonasian_minority_fac_pct female_stu_pct nonasian_minority_stu_pct pct_w_academic_plans avg_pubs_per_fac stu_activity_ratio median_time_to_degree_06 {
egen zt`var'_r1 = std(`var') if any_grfp_nochange0508 == 1 & dept_rank1 == 1
egen zt`var'_r2 = std(`var') if any_grfp_nochange0508 == 1 & dept_rank1 != 1
gen zrank_`var' = zt`var'_r1
replace zrank_`var' = zt`var'_r2 if zrank_`var' == .
}
drop zt*

** Create global macros for standardized form by department rank {Binary Vars included as is}
global zrank_peer_quality zrank_avg_GRE 
global zrank_leader_quality zrank_avg_pubs_per_fac zrank_pct_fac_w_grants_06
global zrank_leader_comp zrank_female_fac_pct zrank_pct_interdis_fac zrank_nonasian_minority_fac_pct
global zrank_peer_comp zrank_female_stu_pct zrank_nonasian_minority_stu_pct zrank_pct_w_academic_plans
global zrank_dept_support stu_workspace stu_propsup_dum bin_stuactratio zrank_median_time_to_degree_06 /// 
		ProgramSize_Q4_dum2 ProgramSize_Q4_dum3 ProgramSize_Q4_dum4	
	
** Step 1	
*1* Rank Z-Score Globals, FE, Logit Full
foreach x in any_award_grfp_nochange0508 {
quietly logit `x' $zrank_leader_quality $zrank_leader_comp $zrank_peer_quality $zrank_peer_comp $zrank_dept_support $uni_trait i.nrc_dept_full_cd
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/AltRankME.xls", replace dec(3) e(ll r2_p rmse) ctitle(Logit, Step 1, Z-Score Rank ME, Full) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
}

*2* Rank Z-Score Globals, FE, Logit Strat by Rank
foreach x in any_award_grfp_nochange0508 {
preserve
keep if dept_rank1 == 1
quietly logit `x' $zrank_leader_quality $zrank_leader_comp $zrank_peer_quality $zrank_peer_comp $zrank_dept_support $uni_trait i.nrc_dept_full_cd
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/AltRankME.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Step 1, Z-Score Rank ME, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
restore

preserve
keep if dept_rank1 != 1
quietly logit `x' $zrank_leader_quality $zrank_leader_comp $zrank_peer_quality $zrank_peer_comp $zrank_dept_support $uni_trait i.nrc_dept_full_cd
margins, dydx(*) post
outreg2 using "$dir/Spr16Analysis/AltRankME.xls", append dec(3) e(ll r2_p rmse) ctitle(Logit, Step 1, Z-Score Rank ME, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes)
restore
}

** Step 2
*3* Rank Z-Score Globals, FE, OLS Full
foreach x1 in zrank_awardpro_3 {
quietly reg `x1' $zrank_leader_quality $zrank_leader_comp $zrank_peer_quality $zrank_peer_comp $zrank_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/AltRankME.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Step 2, Z-Score Rank COEF, Full ) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
}	

*4* Rank Z-Score Globals, FE, OLS Strat by Rank
foreach x1 in zrank_awardpro_3 {
preserve
keep if dept_rank1 == 1
quietly reg `x1' $zrank_leader_quality $zrank_leader_comp $zrank_peer_quality $zrank_peer_comp $zrank_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/AltRankME.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Step 2, Z-Score Rank COEF, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore

preserve
keep if dept_rank1 != 1
quietly reg `x1' $zrank_leader_quality $zrank_leader_comp $zrank_peer_quality $zrank_peer_comp $zrank_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/AltRankME.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Step 2, Z-Score Rank COEF, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore
}

** Step 3
*5* Div Z-Score Globals, FE, OLS Full
foreach x1 in zrank_awardpro_2 {
quietly reg `x1' $zrank_leader_quality $zrank_leader_comp $zrank_peer_quality $zrank_peer_comp $zrank_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/AltRankME.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Step 3, Z-Score Rank COEF, Full) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
}	

*6* Rank Z-Score Globals, FE, OLS Strat by Rank
foreach x1 in zrank_awardpro_2 {
preserve
keep if dept_rank1 == 1
quietly reg `x1' $zrank_leader_quality $zrank_leader_comp $zrank_peer_quality $zrank_peer_comp $zrank_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/AltRankME.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Step 3, Z-Score Rank COEF, Rank 1) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore

preserve
keep if dept_rank1 != 1
quietly reg `x1' $zrank_leader_quality $zrank_leader_comp $zrank_peer_quality $zrank_peer_comp $zrank_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
outreg2 using "$dir/Spr16Analysis/AltRankME.xls", append dec(3) e(ll r2_p rmse) ctitle(OLS, Step 3, Z-Score Rank COEF, Rank 2 and 3) label drop(i.nrc_dept_full_cd) addtext(Fixed Effects, Yes) 
restore
}

** Check Multicollinearity
* Note Cannot run VIF after Logit - using OLS for EQ1 Check
log using "$dir/Spr16Analysis/VIF.log", replace
quietly reg any_award_grfp_nochange0508 $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd
estat vif
quietly reg any_award_grfp_nochange0508 $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd if dept_rank1 == 1
estat vif
quietly reg any_award_grfp_nochange0508 $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd if dept_rank1 != 1
estat vif

quietly reg z_award_pro_nochange0508_3div $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd, cluster (nrc_dept_full_cd)  
estat vif
quietly reg z_award_pro_nochange0508_3div $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd if dept_rank1 == 1, cluster (nrc_dept_full_cd)  
estat vif
quietly reg z_award_pro_nochange0508_3div $zdiv_leader_quality $zdiv_leader_comp $zdiv_peer_quality $zdiv_peer_comp $zdiv_dept_support $uni_trait i.nrc_dept_full_cd if dept_rank1 != 1, cluster (nrc_dept_full_cd)  
estat vif
log close
}

* END
